<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link type="text/css" rel="stylesheet" href="../../static/css/style.css" th:href="@{/css/style.css}"/>
    <link type="text/css" rel="stylesheet" href="../../static/css/public.css" th:href="@{/css/public.css}"/>
</head>
<body>
<!--头部-->
<div th:replace="commons/common::header"></div>
<div th:replace="commons/common::time"></div>
<section class="publicMian ">
    <div th:replace="commons/common::left"></div>
    <div class="location">
        <strong>你现在所在的位置是:</strong>
        <span>用户管理页面 >> 用户添加页面</span>
    </div>
    <div class="providerAdd">
        <form id="userForm" name="userForm" th:action="@{/user/doadd}" method="post" enctype="multipart/form-data" >
            <!-- <input type="hidden" name="method" value="add"> -->
            <!--div的class 为error是验证错误，ok是验证成功-->
            <div>
                <label for="userCode">用户编码：</label>
                <input type="text" name="userCode" id="userCode" value="" th:value="${user!=null}?${user.userCode}"/>
                <!-- 放置提示信息 -->
                <font color="red"></font>
            </div>
            <div>
                <label for="userName" >用户名称：</label>
                <input type="text" name="userName" id="userName" value="" th:value="${user!=null}?${user.userName}"/>
                <font color="red"></font>
            </div>
            <div>
                <label for="userPassword" >用户密码：</label>
                <input type="password" name="userPassword" id="userPassword" value=""/>
                <font color="red"></font>
            </div>
            <div>
                <label for="ruserPassword">确认密码：</label>
                <input type="password" name="ruserPassword" id="ruserPassword" value=""/>
                <font color="red"></font>
            </div>
            <div>
                <label for="gender">用户性别：</label>
                <select name="gender" id="gender" th:selected="${user!=null}?${user.gender}">
                    <option value="1" selected="selected">男</option>
                    <option value="2">女</option>
                </select>
            </div>
            <div>
                <label for="birthday">出生日期：</label>
                <input type="text" Class="Wdate" id="birthday" name="birthday"
                       readonly="readonly" onclick="WdatePicker();" th:value="${user!=null}?${user.birthday}"/>
                <font color="red"></font>
            </div>
            <div>
                <label for="phone">用户电话：</label>
                <input type="text" name="phone" id="phone" value="" th:value="${user!=null}?${user.phone}"/>
                <font color="red"></font>
            </div>
            <div>
                <label for="address">用户地址：</label>
                <input name="address" id="address"  value="" th:value="${user!=null}?${user.address}"/>
            </div>
            <div>
                <label for="userRole">用户角色：</label>
                <!-- 列出所有的角色分类 -->
                <select name="userRole" id="userRole" >
                    <option th:each="role:${rolelist}" th:value="${role.id}" th:text="${role.roleName}" th:selected="${user!=null}?${user.userRole==role.id}"></option>
                </select>
                <font color="red"></font>
            </div>
            <div>
                <label for="idFile">证件照：</label>
                <input name="idFile" id="idFile" type="file">
                <font color="red"></font>
            </div>
            <div class="providerAddBtn">
                <input type="submit" name="add" id="addBtn" value="保存" >
                <input type="button" id="back" name="back" value="返回" >
            </div>
        </form>
    </div>
</section>

<div th:replace="commons/common::footer"></div>
<script type="text/javascript" src="../../static/js/time.js" th:src="@{/js/time.js}"></script>
<script type="text/javascript" src="../../static/js/jquery-1.8.3.min.js" th:src="@{/js/jquery-1.8.3.min.js}"></script>
<script type="text/javascript" src="../../static/js/common.js" th:src="@{/js/common.js}"></script>
<script type="text/javascript" src="../../static/calendar/WdatePicker.js" th:src="@{/calendar/WdatePicker.js}"></script>
<script>

</script>
</body>
</html>